﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class edit : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["username"] == null)
            {
                Response.Redirect("default.aspx");
            }
            snIpt.Text = Request.QueryString["sn"].ToString();
            snIpt.Enabled = false;

            NVR.BLL.NVRDevInfo nvr = new NVR.BLL.NVRDevInfo();
            NVR.Entity.NVRDeviceInfo nvrInfo = new NVR.Entity.NVRDeviceInfo();
            nvrInfo = nvr.GetNVRInfoBySn(snIpt.Text);
            if (nvrInfo != null)
            {
                nvrAdminIpt.Text = nvrInfo.deviceAdmin;
                nvrPwdIpt.Text = nvrInfo.devicePwd;
                nvrCfmPwdIpt.Text = nvrInfo.devicePwd;
                nvrUserIpt.Text = nvrInfo.username;
                nvrLocIpt.Text = nvrInfo.deviceLoc;
            }
        }
    }
}